package com.ly.service;

import com.ly.entities.CommonResult;
import com.ly.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Feign的引用为，创建新的接口+@FeignClient注解即可，调用provider服务
 * Feign自带负载均衡配置项
 */
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
@Component
public interface PaymentFeignService {

    @GetMapping("/payment/get/{id}")//对应提供服务的路径、
    //getPaymentById2222为了区别没必要和提供服务的方法名保持一致，只需要将路径配置好就可以了
    public CommonResult<Payment> getPaymentById2222(@PathVariable("id") String id);

    @GetMapping(value = "/payment/paymentFeignTimeout")
    public String paymentFeignTimeout();
}
